home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1995 #5 & #6
/
Amiga Plus CD - 1995 - No. 5 and 6.iso
/
pd
/
emulator
/
st
/
st.s
< prev
Wrap
Text File
|
1995-08-23
|
2KB
|
132 lines
; © Stefan Haubenthal 1992-95
* opt o+
* include prog:asm/include/wb.i
* incdir prog:asm/include
* include easystart.i
version= "2.10"
allocabs= -$0cc
freemem= -$0d2
oldopenlibrary= -$198
closelibrary= -$19e
open= -$01e
read= -$02a
datestamp= -$0c0
copymemquick= -$276
mode_oldfile= 1005
io= $18000; 32K
emu= $20000
temp= $23100; 24 bytes
buffer= $24000
scr= $30000
scrsize= $8000; ± 32K
dsk= $38004
dsksize= $4000; 16K
rom= $40000
romsize= $40000; 256K/192K
oldrom= $fc0000
move.l 4.w,a6
move.l #romsize,d0
lea rom,a1
jsr allocabs(a6)
tst.l d0
beq exit
move.l #emusize,d0
lea emu,a1
jsr allocabs(a6)
tst.l d0
beq.s exit
lea dosname(pc),a1
jsr oldopenlibrary(a6)
move.l d0,a6
move.l #romname,d1
move.l #mode_oldfile,d2
jsr open(a6)
beq.s exit2
move.l d0,d1
move.l #rom,d2
move.l #romsize,d3
jsr read(a6)
bsr.s patch
bsr.s time
move.l 4.w,a6
lea start_emu,a0
lea emu,a1
move.l #emusize,d0
jsr copymemquick(a6)
jmp emu+4
; goodbye AmigaDOS!
exit2 move.l a6,a1
move.l 4.w,a6
jsr closelibrary(a6)
move.l #emusize,d0
lea emu,a1
jsr freemem(a6)
exit moveq #20,d0
rts
patch lea reloc,a0
sub.l a1,a1
next_reloc moveq #0,d0
cmp #0,(a0)
add (a0)+,a1
bne.s not_packed
move.b (a0)+,d0
move.b (a0)+,d1
next_packed add d1,a1
not_packed sub.b #(oldrom-rom)>>16,(a1,d2.l)
dbra d0,next_packed
cmp.l #diff,a0
blo.s next_reloc
next_diff move.l (a0)+,a1
move (a0)+,d0
move.b d0,(a1,d2.l)
cmp.l #end_diff,a0
blo.s next_diff
rts
DIGITS macro
move.b d0,d2
and.b #$f,d2
move.b d2,\1
lsr.b #4,d0
move.b d0,\2
endm
time move.l #vector,d1
jsr datestamp(a6)
move.l vector+4,d0
divu #60,d0 ; hours
DIGITS start_emu+$57,start_emu+$5f
swap d0 ; minutes
DIGITS start_emu+$47,start_emu+$4f
move.l vector+8,d0
divu #50,d0 ; seconds
DIGITS start_emu+$37,start_emu+$3f
rts
dc.b "$VER: ST4Amiga V"
dc.l version
dc.b 0
dosname dc.b "dos.library",0
romname dc.b "TOS.IMG",0
vector ds.l 3
data
; { delta_offset.w
; | 0.w number-1.b delta_offset.b }
reloc include reloc.asm
; { offset.l data.w }
diff include diff.asm
end_diff
code
temp1 EQU temp
temp2 EQU temp1+2
temp3 EQU temp2+2
temp4 EQU temp3+2
start_emu include emu.asm
emusize= *-emu
end